package com.zl.payment.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.zl.payment.entity.ConsumptionBill;
import com.zl.payment.mapper.ConsumptionBillMapper;
import com.zl.payment.service.IConsumptionBillService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.omg.CORBA.PRIVATE_MEMBER;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

/**
 * <p>
 *  服务实现类
 *  消费账单：当前月份账户新增的消费账单
 *  出账日所在的月份为账单月份。
 *
 * </p>
 *
 * @author hemuqing
 * @since 2020-07-15
 */
@Service
public class ConsumptionBillServiceImpl extends ServiceImpl<ConsumptionBillMapper, ConsumptionBill> implements IConsumptionBillService {
   /* private final String ACCOUNT_DATE = "ACCOUNT_DATE";
   
   
    @Autowired
    private ConsumptionBillMapper consumptionBillMapper;
    
*//**
 * 根据给定的出账日返回这天的所有消费账单
 * @param date
 * @return
 *//*
    public List<ConsumptionBill> getConsumptionBillByDay(Date date){
        QueryWrapper<ConsumptionBill> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq(ACCOUNT_DATE,date);
        List<ConsumptionBill> consumptionBills = consumptionBillMapper.selectList(queryWrapper);
        return consumptionBills;
    }

*//**
 * 根据信用卡账号和账单月份返回当前账号的该月的消费账单。
 * @param creditCardId
 * @param month
 * @return
 *//*

    *//*public  ConsumptionBill getConsumptionBillByCardAndMonth(String creditCardId,Integer month){
        QueryWrapper<ConsumptionBill> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq(CREDIT_CARD_ID,creditCardId);
        queryWrapper.eq(BILLING_MONTH,month);
        ConsumptionBill consumptionBill = consumptionBillMapper.selectOne(queryWrapper);
        return consumptionBill;
    }*//*

*//**
 * 修改账单为已出账状态。
 * @param consumptionBill
 * @return
 *//*
  *//*  public Integer updateAccountStatus(ConsumptionBill consumptionBill){
        UpdateWrapper<ConsumptionBill> updateWrapper = new UpdateWrapper<>();
        updateWrapper.eq(ACCOUNT_STATUS,1);
        int result = consumptionBillMapper.update(consumptionBill, updateWrapper);
        return result;
    }*//*

*//**
 * 单条插入消费账单记录
 * @param consumptionBill
 * @return
 *//*
    public Integer addConsumptionBill(ConsumptionBill consumptionBill){
        int insert = consumptionBillMapper.insert(consumptionBill);
        return insert;
    }
    
    */
    
    
    
    
    
}
